package org.mechanic.exception;

import org.mechanic.core.web.HttpStatusCode;

/**
 * 非法参数异常
 */
@SuppressWarnings("serial")
public class IllegalParameterException extends BaseException {
    public IllegalParameterException() {
    }

    public IllegalParameterException(Throwable ex) {
        super(ex);
    }

    public IllegalParameterException(HttpStatusCode httpStatusCode, String message) {
        super(HttpStatusCode.defineHttpStatusCode(httpStatusCode, message));
        httpStatusCode.setMessage(message);
    }

    public IllegalParameterException(String message) {
        this(HttpStatusCode.defineHttpStatusCode(message));
    }

    public IllegalParameterException(String message, Throwable ex) {
        super(message, ex);
    }

    public IllegalParameterException(HttpStatusCode httpStatusCode, Exception e) {
        super(httpStatusCode, e);
    }

    public IllegalParameterException(HttpStatusCode httpStatusCode) {
        super(httpStatusCode);
    }

    protected HttpStatusCode getHttpStatusCode() {
        return HttpStatusCode.PARAM_ILLEGAL;
    }
}
